//
//  LFZItemButton.swift
//  Swift微博
//
//  Created by MagicalStar Pro on 15/12/29.
//  Copyright © 2015年 liang. All rights reserved.
//

import UIKit

class LFZItemButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        imageView?.contentMode = UIViewContentMode.Center
        
        titleLabel?.contentMode = UIViewContentMode.Center
        
        titleLabel?.textAlignment =  NSTextAlignment.Center
        
        titleLabel?.font = UIFont.systemFontOfSize(13)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        let wid = bounds.size.width
        
        let hit = bounds.size.height
        
        imageView?.frame = CGRectMake(0, 0, wid, hit*0.7)
        
        titleLabel?.frame = CGRectMake(0, hit*0.7, wid, hit*0.3)
       
    }

}
